package com.two.service.permission.controller.api;

import com.two.common.entity.Permission;
import com.two.common.entity.User;
import com.two.common.util.CommonResult;
import com.two.service.permission.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 汪瑞明
 * @since 2022-08-29
 */
@RestController
@RequestMapping("api/permission/permission")
public class ApiPermissionController {
    @Autowired
    private IPermissionService permissionService;
    //根据id查询当前登录者的所有网页的地址
    @RequestMapping("selectByUserId")
    public List<Permission> selectPermissionByUserid(@RequestParam Integer userid){
        return permissionService.selectPermissionByUserid(userid);
    }
        //根据账号查询信息
    @RequestMapping("selectByUsername")
    public User selectByUsername(@RequestParam String username){
        return permissionService.selectOne(username);
    }


}
